var t = require;
var e = module;
var o = exports;
var a,
    i =
        (this && this.__extends) ||
        ((a = function (t, e) {
            return (a =
                Object.setPrototypeOf ||
                ({__proto__: []} instanceof Array &&
                    function (t, e) {
                        t.__proto__ = e;
                    }) ||
                function (t, e) {
                    for (var o in e) Object.prototype.hasOwnProperty.call(e, o) && (t[o] = e[o]);
                })(t, e);
        }),
        function (t, e) {
            a(t, e);
            function o() {
                this.constructor = t;
            }
            t.prototype = null === e ? Object.create(e) : ((o.prototype = e.prototype), new o());
        }),
    n =
        (this && this.__decorate) ||
        function (t, e, o, a) {
            var i,
                n = arguments.length,
                r = n < 3 ? e : null === a ? (a = Object.getOwnPropertyDescriptor(e, o)) : a;
            if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) r = Reflect.decorate(t, e, o, a);
            else
                for (var s = t.length - 1; s >= 0; s--)
                    (i = t[s]) && (r = (n < 3 ? i(r) : n > 3 ? i(e, o, r) : i(e, o)) || r);
            return n > 3 && r && Object.defineProperty(e, o, r), r;
        };
Object.defineProperty(o, "__esModule", {value: !0});
var r = t("UIBase"),
    s = t("UIConfig"),
    c = t("UIManager"),
    p = t("AdView"),
    l = cc._decorator,
    d = l.ccclass,
    u =
        (l.property,
        l.menu,
        (function (t) {
            i(e, t);
            function e() {
                return (null !== t && t.apply(this, arguments)) || this;
            }
            e.prototype.onShowEnd = function () {
                var t = this;
                AdView.showAd(
                    function () {
                        console.log("来着升级跳转界面,嵌入");
                    },
                    {type: p.AdTypeEm.implant}
                );
                var e = GameDataValue.getLastLv(),
                    o = e + 1,
                    a = CacheDataManager.getChapterRoomId(e),
                    i = CacheDataManager.getChapterRoomId(o);
                GameDataValue.setSelLv(GameDataValue.getLastLv() + 1);
                var n = CacheDataManager.getRestaurant(a, e),
                    r = CacheDataManager.getRestaurant(i, o);
                SpriteView.setTaskSprite(this._room1.$Sprite, n.icon);
                SpriteView.setTaskSprite(this._room2.$Sprite, r.icon);
                this._detail1.$Label.string = n.desc + "";
                this._detail2.$Label.string = r.desc + "";
                var l = n.reward,
                    d = n.reward_num || 1;
                if (l) {
                    GameDataValue.openNewTip();
                    for (var u = 0; u < d; u++) GameDataValue.addRewardKind(l);
                }
                var h = e % 7;
                if (6 == h) {
                    h = 7;
                    c.default.open(s.UIID.UIChangeScenes, {
                        lv: o,
                        lvIndex: h,
                        isPlay: !1,
                        cb: function () {
                            t.setTime(0);
                        }
                    });
                } else this.setTime(3);
            };
            e.prototype.setTime = function (t) {
                var e = this;
                AdView.hideAd(p.AdTypeEm.implant);
                if (t > 0)
                    this.scheduleOnce(function () {
                        e.setTime(t - 1);
                    }, 1);
                else {
                    c.default.open(s.UIID.UILoading, {tip: "", delayTime: 0.1});
                    this.ui_data.cb && this.ui_data.cb();
                    this.closeUI();
                }
            };
            return n([d], e);
        })(r.default));
o.default = u;
